import 'package:equatable/equatable.dart';
import 'package:meta/meta.dart';

/// 定时器事件
@immutable
abstract class TimerEvent extends Equatable{

  const TimerEvent();

  @override
  List<Object> get props => [];
}

/// 开始时间
class Start extends TimerEvent {
  /// 定时器时间
  final int duration;

  const Start({@required this.duration});

  @override
  String toString() => 'Start { duration: $duration }';
}

/// 暂停事件
class Pause extends TimerEvent {}

/// 恢复状态
class Resume extends TimerEvent {}

/// 重置状态
class Reset extends TimerEvent {}

/// 定时器事件
class Tick extends TimerEvent {
  /// 当前时间
  final int duration;

  const Tick({@required this.duration});

  @override
  List<Object> get props => [this.duration];

  @override
  String toString() => 'Tick { duration: $duration }';
}
